<template>
  <div>
    <el-col :span="24" style="height: 100%;">
      <div style="height: 100%;">
        <el-row>
          <!--          <pagination total="1"></pagination>-->
          <el-table :max-height="700" :data="submitList" stripe border>
            <el-table-column label="学生姓名" prop="name" align="center"
                             :show-overflow-tooltip="true" width="300"
            />
            <el-table-column label="学生学号" prop="number" align="center"
                             :show-overflow-tooltip="true" width="300"
            />
            <el-table-column label="操作" align="center" width="300"
                             class-name="small-padding fixed-width"
            >
              <div slot-scope="scope" >
                <el-button size="mini"
                           @click="handleUpdate(scope.row)"
                           v-if="scope.row.status !== 1"
                >详情</el-button
                >
              </div>
            </el-table-column>
          </el-table>
          <pagination v-show="true" :page-sizes="[5]" :layout="'prev, pager, next'"
                      :total="total" :page.sync="queryParams.pageNum"
                      :limit.sync="queryParams.pageSize" @pagination="getPage"
          />
        </el-row>
      </div>
    </el-col>
  </div>
</template>
<script>
import Vertical from "@/layout/ManageMenu";
import Pagination from "@/components/Pagination";
import SearchBox from "@/views/reservation/search";
import {submitInfo} from "@/api/questionnaire";

export default {
  name: 'SubmitDetail',
  components: {
    SearchBox,
    Vertical,
    Pagination
  },
  props: {
    submitList:{

    },
    total:{

    },
    questionnaireId:{

    }
  },
  data() {
    return {
      // 遮罩层
      loading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,

      scoreOpen: false,
      scores: {},

      // 日期范围
      dateRange: [],
      // 菜单列表
      menuOptions: [],
      // 部门列表
      deptOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 5,
        questionnaireId: null
      },
      // 表单参数
      form: {},
      // 表单校验
      defaultProps: {
        children: "children",
        label: "label",
      },
      statusList:[
        {
          id:0,
          label:"待开始"
        },
        {
          id:1,
          label:"已结束"
        },
      ],
    };
  },
  methods: {
    //分页查询
    getPage(data) {
      this.queryParams.questionnaireId=this.questionnaireId
      // this.loading = true;
      submitInfo(this.queryParams)
        .then((response) => {
          if (response.success) {
            this.submitList=response.data.records
          }
        })
        .catch((e) => {
          _this.$message.error(e, "出现未知错误");
        });
    },

  },
}
</script>

<style lang="scss" scoped>
.auto-generate-form {
  padding-top: 50px;
  padding-right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
</style>
